﻿using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace CommonManagement
{
    /// <summary>
    /// 舒适度
    /// </summary>
    public class ComfortLevel : Entity<int>
    {
        /// <summary>紫外线强度</summary>
        public int Uv { get; protected set; }

        /// <summary>穿衣指数</summary>
        public string DressingIndex { get; protected set; }

        /// <summary>感冒指数</summary>
        public string ColdIndex { get; protected set; }

        /// <summary>洗车指数</summary>
        public string WashIndex { get; protected set; }

        /// <summary>运动指数</summary>
        public string SportIndex { get; protected set; }

        /// <summary>紫外线指数</summary>
        [NotMapped]
        public string UvIndex
        {
            get
            {
                switch (Uv)
                {
                    case 0:
                    case 1:
                    case 2:
                        return "弱";
                    case 3:
                    case 4:
                        return "较低";
                    case 5:
                    case 6:
                        return "中等";
                    case 7:
                    case 8:
                    case 9:
                        return "较强";
                    case 10:
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                        return "强";
                    default:
                        return "未知";
                }
            }
        }

        /// <summary>天气信息</summary>
        [ForeignKey("Id")]
        public Weather Forecast { get; protected set; }

        private ComfortLevel() { }
    }
}